<?php
class Minutetype extends AppModel {

    var $name = 'Minutetype';
    var $validate = array(
        'type' => array('notempty')
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed
    var $hasMany = array(
        'Committee' => array(
            'className' => 'Committee',
            'foreignKey' => 'minutetype_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );

    function formatList(){

        // find all minute format, put it in key=>value format for dropdown in committees/add + committees/view
        $this->unbindModel(array('hasMany'=>array('Committee')));
        $minuteformat = $this->find('all');
        $minuteformatval = Set::extract($minuteformat,'/Minutetype/type');
        $minuteformatkey = Set::extract($minuteformat,'/Minutetype/id');
        $minuteformat = array();
        foreach ($minuteformatkey as $thekey => $theid) $minuteformat[$theid] = $minuteformatval[$thekey];
        return $minuteformat;
    }
}
?>